//
//  LGTreeView.m
//  ligenyun
//
//  Created by Mac on 2018/4/9.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGTreeView.h"
@interface LGTreeView()
@property(nonatomic, strong) UIImageView                     *iconImageView;
@property(nonatomic, strong) STLabel                     *titleLable;

@end
@implementation LGTreeView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configSubView];
    }
    return self;
}
#pragma mark --subView
- (void)configSubView{

    self.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    
    [self setBackgroundImage:[UIImage imageNamed:@"起始姓名"] forState:UIControlStateNormal];
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 80, self.width,16 )
                                                     text:@"父亲"
                                                textColor:FirstTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    [self addSubview:titleLable];
    
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, titleLable.bottom, 15, 15)];
    self.iconImageView.image = [UIImage imageNamed:@"亲友_添加10"];
    self.iconImageView.centerX = self.width / 2;
    self.iconImageView.userInteractionEnabled = NO;
    [self addSubview:self.iconImageView];
    [self addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
}
- (void)action{
    if (self.clicAction) {
        self.clicAction(self);
    }
}
@end
